package com.qf.service.impl;

import com.qf.mapper.CategoryMapper;
import com.qf.pojo.Category;
import com.qf.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional
public class CategoryServiceImpl implements CategoryService {

    private CategoryMapper categoryMapper;
    @Autowired
    public void setCategoryMapper(CategoryMapper categoryMapper) {
        this.categoryMapper = categoryMapper;
    }


    @Override
    public List<Category> findAllCategory() {
        List<Category> categoryList = categoryMapper.findAllCategory();
        return categoryList;
    }

    @Override
    public void addcategory(String categoryName) {
        categoryMapper.addCategory(categoryName);
    }


}
